package subsystems

type ResourceConfig struct {
	MemoryLimit string
	CpuShare 	string
	CpuSet 		string
}

type Subsystem interface {
	// return subsystem's name
	Name() string
	// set limit of resource for cgroup
	Set(path string, res *ResourceConfig) error
	// add process to the cgroup
	Apply(path string, pid int) error
	// remove cgroup
	Remove(path string) error
}

var (
	SubsystemsIns = []Subsystem{
		&MemorySubsystem{},
		&CpusetSubSystem{},
		&CpuSubSystem{},
	}
)

